package com.itheima.io.字符流;

import java.io.FileReader;
import java.io.IOException;

public class CharDtreamDemo3 {
    public static void main(String[] args) throws IOException {
        //创建字符输入流对象
        FileReader fr = new FileReader("day12_IO流_字符流\\a.txt");

        //循环读取
        //定义中间量
       /* int b;
        while ((b = fr.read()) != -1){
            System.out.print((char)b);
        }*/

       //一次读取一个字符数组
        char[] chars = new char[1024];
        int len;
        while ((len = fr.read(chars)) != -1){
            System.out.print(new String(chars,0,len));
        }



        //关流,释放资源
        fr.close();
    }
}
